//
//  TFFormTableViewController.h
//  WebPDA
//
//  Created by Justin Yip on 8/14/10.
//  Copyright 2010 TenNights.com. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "FTValueHolder.h"

/*
 the form table control
 */
@interface FTFormTableViewController : UITableViewController {
	NSBundle *formBundle;
	//cell descriptions
	NSArray *preferenceSpecifiers;
	//section indexes of preference specifiers
	NSArray *sectionIndexes;
	FTValueHolder *valueHolder;
	UINavigationController *navigationController;
}
/*
 load Root.plist in bundle
 */
-(void)loadBundle:(NSString *)bundleName;
/*
 @param fileName should not contain .plist extension
 @param bundleName bundle name
 */
-(void)loadFile:(NSString*)fileName inBundleName:(NSString*)bundleName;
/*
 @param fileName should not contain .plist extension
 @param bundle bundle instance
 */
-(void)loadFile:(NSString*)fileName inBundle:(NSBundle*)bundle;

@property(nonatomic,retain) id entity;
@property(nonatomic,retain) FTValueHolder *valueHolder;

@property(nonatomic,retain) NSBundle *formBundle;
@property(nonatomic,retain) NSArray *preferenceSpecifiers;
@property(nonatomic,retain) NSArray *sectionIndexes;

@property(nonatomic,retain) IBOutlet UINavigationController *navigationController;

@end

#define	BUNDLE_TYPE_PLIST @"plist"
#define BUNDLE_TYPE_YAML @"yaml"